checkArgumentNonnegative

@IntRange(from = 0)
open fun checkArgumentNonnegative(value: Int, @Nullable errorMessage: String): Int(source)

Ensures that that the argument numeric value is non-negative.

Return

the validated numeric value

Parameters

value

a numeric int value

errorMessage

the exception message to use if the check fails

Throws

if value was negative


@IntRange(from = 0)
open fun checkArgumentNonnegative(value: Int): Int(source)

Ensures that that the argument numeric value is non-negative.

Return

the validated numeric value

Parameters

value

a numeric int value

Throws

if value was negative